using System;
using System.Diagnostics;

namespace Tasks
{
	public class FuncTask : ITask
	{
		public FuncTask(Action _func)
		{
			this.func = _func;
		}

		//[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		public event Action onComplete;

		public bool isDone { get; set; }

		public void Execute()
		{
			this.func();
			this.isDone = true;
			if (this.onComplete != null)
			{
				this.onComplete();
			}
		}

		private Action func;
	}
}
